package com.joplus.housekeeper.core;

import com.joplus.housekeeper.R;
import com.joplus.housekeeper.bean.OrderListBeanNew;

/**
 * Created by Administrator on 2016/7/19.
 */
public class BaseOrderType {


    /**
     * 3及是代排队又是不等位 所以cnmb   随你们玩吧
     * <p>
     * card";//卡片订单
     * "restaurant";///餐厅订单
     * noWait 不等位
     * Generation //带排队
     * <p>
     * life //生活订单
     * Free 免费体验
     * linqudaisong linqudaipaidui linqusuiyigou
     */
    public enum OrderType {
        Card, Event, NoWait, Generation, Life, Store, Free, LinQu, LinQuRandom, LinQuQueue, UnKnow, BAG, WINE, WINECARD, WINEGIFT, PRIVATEFLIGHT, EDUCATION, MATRON, INFANT, XDOCTOR, DOCTORSPECIAL, DOCTORCARD, DOCTORGIFT, DOCTORHKCARD, DOCTORHKGIFT, FLIGHT, FLIGHTCARD, FLIGHTGIFT, ACCOMPENT, HOTEL
    }




    public static OrderType getOrderType(OrderListBeanNew orderListBean) {
        if (orderListBean == null) {
            throw new IllegalArgumentException("OrderListBean 不能为null");
        }
        if (orderListBean.getOrderType().equals("event")) {
            return OrderType.Event;
        } else if (orderListBean.getOrderType().equals("1")) {
            return OrderType.NoWait;
        } else if (orderListBean.getOrderType().equals("2")) {
            return OrderType.Generation;
        } else if (orderListBean.getOrderType().equals("3")) {
            return OrderType.Generation;
        } else if (orderListBean.getOrderType().equals("5")) {
            return OrderType.WINE;
        } else if (orderListBean.getOrderType().equals("6")) {
            return OrderType.WINECARD;
        } else if (orderListBean.getOrderType().equals("7")) {
            return OrderType.WINEGIFT;
        } else if (orderListBean.getOrderType().equals("11")) {
            return OrderType.PRIVATEFLIGHT;
        } else if (orderListBean.getOrderType().equals("14")) {
            return OrderType.EDUCATION;
        } else if (orderListBean.getOrderType().equals("16")) {
            return OrderType.MATRON;
        } else if (orderListBean.getOrderType().equals("15")) {
            return OrderType.INFANT;
        } else if (orderListBean.getOrderType().equals("17")) {
            return OrderType.XDOCTOR;
        } else if (orderListBean.getOrderType().equals("18")) {
            return OrderType.DOCTORSPECIAL;
        } else if (orderListBean.getOrderType().equals("19")) {
            return OrderType.DOCTORCARD;
        } else if (orderListBean.getOrderType().equals("20")) {
            return OrderType.DOCTORGIFT;
        } else if (orderListBean.getOrderType().equals("21")) {
            return OrderType.DOCTORHKCARD;
        } else if (orderListBean.getOrderType().equals("22")) {
            return OrderType.DOCTORHKGIFT;
        } else if (orderListBean.getOrderType().equals("23")) {
            return OrderType.FLIGHTCARD;
        } else if (orderListBean.getOrderType().equals("24")) {
            return OrderType.FLIGHTGIFT;
        } else if (orderListBean.getOrderType().equals("25")) {
            return OrderType.FLIGHT;
        } else if (orderListBean.getOrderType().equals("26")) {
            return OrderType.ACCOMPENT;
        } else if (orderListBean.getOrderType().equals("27")) {
            return OrderType.HOTEL;
        } else if (orderListBean.getOrderType().equals("linqudaisong")) {
            return OrderType.LinQu;
        } else if (orderListBean.getOrderType().equals("linqu")) {
            //旧邻趣订单
            return OrderType.LinQu;
        } else if (orderListBean.getOrderType().equals("linqudaipaidui")) {
            return OrderType.LinQuQueue;
        } else if (orderListBean.getOrderType().equals("linqusuiyigou")) {
            return OrderType.LinQuRandom;
        } else if (orderListBean.getOrderType().equals("free")) {
            return OrderType.Free;
        } else if (orderListBean.getOrderType().equals("life")) {
            return OrderType.Life;
        } else if (orderListBean.getOrderType().equals("storedproduct")) {
            return OrderType.BAG;
        } /*else if (orderListBean.getOther() != null) {
            if (orderListBean.getOther().getOrderType() != null && orderListBean.getOther().getOrderType().equals("product")) {
                return OrderType.Store;
            } else {
                //冲突  找到包包需要在这里甄别
                if (orderListBean.getOrderType().equals("storedproduct")) {
                    return OrderType.BAG;
                }
                return OrderType.Card;
            }
        } */else {
            return OrderType.UnKnow;
        }
    }

    public static int name(OrderType type) {
        if (type.equals(OrderType.Life)) {
            return R.string.life_service;
        } else if (type.equals(OrderType.Free)) {
            return R.string.exp_free;
        } else if (type.equals(OrderType.LinQu)) {
            return R.string.goods_send;
        } else if (type.equals(OrderType.LinQuQueue)) {
            return R.string.linqu_queue;
        } else if (type.equals(OrderType.LinQuRandom)) {
            return R.string.linqu_random;
        } else if (type.equals(OrderType.BAG)) {
            return R.string.linqu_random;
        } else if (type.equals(OrderType.WINE)) {
            return R.string.wine;
        } else if (type.equals(OrderType.WINECARD)) {
            return R.string.wine_card;
        } else if (type.equals(OrderType.WINEGIFT)) {
            return R.string.wine_gift;
        } else if (type.equals(OrderType.PRIVATEFLIGHT)) {
            return R.string.private_flight;
        } else if (type.equals(OrderType.EDUCATION)) {
            return R.string.edcition;
        } else if (type.equals(OrderType.UnKnow)) {
            return 0;
        }

        return 0;
    }

}
